package BNS.surveys;

import java.rmi.*;
import BNS.plumbing.*;

/* A remote interface, which is needed for the MarketISGame game.
It specifies what methods the MatchingPersona may access, and thus determines 
what information can be passed to the central game coordinator on the server.
*/
public interface MarketISLiaisonInterface extends ClientLiaisonInterface {

	/** used to change state of a node to a new color.
	@param nodeID the identifying number of the node in the game graph.
	The caller must be the client operating that node. 
	@param color an int indicating the new color of the node (1 for YELLOW, 2 for RED).
	@return indicates success at making the change.
	It returns true iff the game is not over, the game is not paused, 
	the nodeID looks legitimate, and the color is in {1, 2}. 
	*/
	public boolean alter(int color) throws RemoteException;

	/** used to make promises to all neighbouring nodes. The promise is of the form 
	"If you play Yellow & I get to play Red unopposed, I will pay you ___".
	<p>
	The method and returns true if the game is not over, 
	the game is not paused, the clientID looks legitimate, and the sum of the 
	bids is no bigger than feasible.
	Otherwise it returns false to let the MarketISPersona know that its action failed.
	If it returns true, then it also records the new values of the bids;
	otherwise it ignores the information.
	<p>
	The Client is required to correctly declare his own clientID.
	The Game must guard against Clients attempting deception in the clientID.
	@param clientID the clientID identifying the player, which in turn is
		uniquely identified with a particular node being played.
	@param bids the amount promised to each neighbour if it plays YELLOW and this node plays RED.
		The order in the array is the same as the order in 
	@return indicates success at making the change. It returns true iff 
		the game is not over, 
		the game is not suspended, 
		the clientID looks legitimate, 
		and the sum of the bids is no more than RED payoff. */
	public boolean bid(float[] bids) throws RemoteException;
		
	}
